package com.buchong.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.buchong.pojo.Order_Demo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface Order_DemoMapper  extends BaseMapper<Order_Demo> {
    @Select("select id, orderNum,userId,totalPrice,reducePrice,costPrice,pressPrice,createTime,payTime,sendTime,finishTime,orderStatus from orders where userId=#{id}")
    List<Order_Demo> findAll(Integer id);
    @Select("select id, orderNum,userId,totalPrice,reducePrice,costPrice,pressPrice,createTime,payTime,sendTime,finishTime,orderStatus from orders where userId=#{arg0} and orderStatus=#{arg1}")
    List<Order_Demo> find(Integer id,int type);
    @Insert("insert into orders values(default,#{userMessage},#{userId},#{userMessage},#{totalPrice},#{reducePrice},#{costPrice},#{pressPrice},#{createTime},#{payTime},#{sendTime},#{finishTime},#{orderStatus},#{addrId},#{showw})")
    int add(Order_Demo order_demo);
    @Select("SELECT  id,orderNum,userId,totalPrice,reducePrice,costPrice,pressPrice,createTime,payTime,sendTime,finishTime,orderStatus,showw,userMessage,addrId  FROM orders  WHERE createTime = #{time}")
    Order_Demo sel(String time);
}
